package com.moleq.models;

import com.moleq.db.DatabaseSchema;


public class ItemDiscountSetting {
//	CREATE TABLE IF NOT EXISTS t_discount_setting
//	(ds_no INTEGER NOT NULL,
//	ds_type varchar(1) DEFAULT 'P' NOT NULL, --P-Percent|A-Amount
//	ds_value numeric(8,3) DEFAULT 0 NOT NULL,
//	create_datetime varchar(14) NOT NULL,
//	update_datetime varchar(14) NOT NULL,
//	PRIMARY KEY (ds_no));
	
	private int ds_no; 
	private String ds_type; 
	private String ds_desc;
	private double ds_value; 
	private String create_datetime;
	private String update_datetime;
	
	private boolean ds_follow_item;
	private boolean ds_tax1;
	private boolean ds_tax2;
	private boolean ds_tax3;
	private boolean ds_tax4;
	private boolean ds_tax5;
	private boolean ds_tax6;
	private boolean ds_foodstamp;
	private String flag;
	private boolean isEdit = false;
	
	public ItemDiscountSetting(){}
	public ItemDiscountSetting(int ds_no, String ds_type, String ds_desc,
			double ds_value, String create_datetime, String update_datetime, 
			boolean ds_follow_item, boolean ds_tax1,boolean ds_tax2, 
			boolean ds_tax3, boolean ds_tax4, boolean ds_tax5,
			boolean ds_tax6, boolean ds_foodstamp) {
		this.ds_no = ds_no;
		this.ds_type = ds_type;
		this.ds_desc = ds_desc;
		this.ds_value = ds_value;
		this.create_datetime = create_datetime;
		this.update_datetime = update_datetime;
		this.ds_follow_item = ds_follow_item;
		this.ds_tax1 = ds_tax1;
		this.ds_tax2 = ds_tax2;
		this.ds_tax3 = ds_tax3;
		this.ds_tax4 = ds_tax4;
		this.ds_tax5 = ds_tax5;
		this.ds_tax6 = ds_tax6;
		this.ds_foodstamp = ds_foodstamp;
	}

	public String getDs_desc() {
		return ds_desc;
	}
	public void setDs_desc(String ds_desc) {
		this.ds_desc = ds_desc;
	}
	public int getDs_no() {
		return ds_no;
	}
	public void setDs_no(int ds_no) {
		this.ds_no = ds_no;
	}
	public String getDs_type() {
		return ds_type;
	}
	public void setDs_type(String ds_type) {
		this.ds_type = ds_type;
	}
	public double getDs_value() {
		return ds_value;
	}
	public void setDs_value(double ds_value) {
		this.ds_value = ds_value;
	}
	public boolean isDs_follow_item() {
		return ds_follow_item;
	}
	public void setDs_follow_item(boolean ds_follow_item) {
		this.ds_follow_item = ds_follow_item;
	}
	public boolean isDs_tax1() {
		return ds_tax1;
	}
	public void setDs_tax1(boolean ds_tax1) {
		this.ds_tax1 = ds_tax1;
	}
	public boolean isDs_tax2() {
		return ds_tax2;
	}
	public void setDs_tax2(boolean ds_tax2) {
		this.ds_tax2 = ds_tax2;
	}
	public boolean isDs_tax3() {
		return ds_tax3;
	}
	public void setDs_tax3(boolean ds_tax3) {
		this.ds_tax3 = ds_tax3;
	}
	public boolean isDs_tax4() {
		return ds_tax4;
	}
	public void setDs_tax4(boolean ds_tax4) {
		this.ds_tax4 = ds_tax4;
	}
	public boolean isDs_tax5() {
		return ds_tax5;
	}
	public void setDs_tax5(boolean ds_tax5) {
		this.ds_tax5 = ds_tax5;
	}
	public boolean isDs_tax6() {
		return ds_tax6;
	}
	public void setDs_tax6(boolean ds_tax6) {
		this.ds_tax6 = ds_tax6;
	}
	public boolean isDs_foodstamp() {
		return ds_foodstamp;
	}
	public void setDs_foodstamp(boolean ds_foodstamp) {
		this.ds_foodstamp = ds_foodstamp;
	}
	public String getFlag() {
		return flag;
	}
	public void setFlag(String flag) {
		this.flag = flag;
	}
	public String getCreate_datetime() {
		return create_datetime;
	}
	public void setCreate_datetime(String create_datetime) {
		this.create_datetime = create_datetime;
	}
	public String getUpdate_datetime() {
		return update_datetime;
	}
	public void setUpdate_datetime(String update_datetime) {
		this.update_datetime = update_datetime;
	}
	
	public boolean isEdit() {
		return isEdit;
	}
	public void setEdit(boolean isEdit) {
		this.isEdit = isEdit;
	}
	public String getDs_follow_item(){
		return isDs_follow_item()?"1":"0";
	}
	public String getDs_tax1(){
		return isDs_tax1()?"1":"0";
	}
	public String getDs_tax2(){
		return isDs_tax2()?"1":"0";
	}
	public String getDs_tax3(){
		return isDs_tax3()?"1":"0";
	}
	public String getDs_tax4(){
		return isDs_tax4()?"1":"0";
	}
	public String getDs_tax5(){
		return isDs_tax5()?"1":"0";
	}
	public String getDs_tax6(){
		return isDs_tax6()?"1":"0";
	}
	public String getDs_foodstamp(){
		return isDs_foodstamp()?"1":"0";
	}
	
	public String toMGData(String Action){
		String Result = Action + "|" + DatabaseSchema.ItemDiscountSetting.SCHEMA_NAME 
					+ "|(" + getDs_no() + ",'" + getDs_desc() + "','" + getDs_type() + "',"
					+ getDs_value() +",'" + getCreate_datetime() + "','" + getUpdate_datetime() 
					+ "','" + getDs_follow_item() + "','" + getDs_tax1() + "','" + getDs_tax2()
					+ "','" + getDs_tax3() + "','" + getDs_tax4() + "','" + getDs_tax5() 
					+ "','" + getDs_tax6() + "','" + getDs_foodstamp() + "')";
		return Result;
	}
}
